package com.fangliai.core.entitiy;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.io.Serializable;

/**
 * 高级查询基类提供分页对像
 * @ClassName BaseSearch
 * @Description TODO
 * @Author fangliai
 * @Date 2018/9/1 12:32
 * @Vesion 1
**/
public abstract class BaseSearch<T> implements Serializable  {
    private Integer page;
    private Integer pageSize=20;
    private Boolean isPage=true;
    
    
    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public final Page<T> initPage(){
        return new Page<>(this.page==null?1:page,this.pageSize==null?30:pageSize);
    }
    
    public Boolean getIsPage() {
		return isPage;
	}

	public void setIsPage(Boolean isPage) {
		this.isPage = isPage;
	}

	public abstract QueryWrapper initWrapper();
    
    
}
